package com.bdqn.tsyyds;

import com.bdqn.tsyyds.entity.BookInfo;
import com.bdqn.tsyyds.repository.BookInfoRepostiory;
import com.bdqn.tsyyds.service.book.BookInfoService;

import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;

import javax.annotation.Resource;
import java.util.List;

@RunWith(SpringRunner.class)
@SpringBootTest
public class Book_info {
    @Resource
    BookInfoRepostiory bookInfoRepostiory;

    @Test
    public void okpppppp(){
        List<BookInfo>book_infos=bookInfoRepostiory.findAll();
        for (BookInfo book_info : book_infos) {
            System.out.println(book_info.getBoorrow().getBorrowTime());
       }
    }

    /*
    *已ID查询相关的所有信息
     */

    @Test
    public void okoko(){
     List<BookInfo>list=bookInfoRepostiory.findById(1);
     for (BookInfo bookInfo : list) {
      System.out.println(bookInfo.getBookName()+bookInfo.getBoorrow().getBorrowTime());
     }
    }
}
